package com.changli01.use.exer2;

import org.junit.Test;

import java.util.ArrayList;
import java.util.function.Predicate;

public class Exer2 {
    @Test
    public void test() {
        ArrayList<Integer> list = new ArrayList<Integer>();
        for (int i = 0; i < 5; i++) {
            int randint = (int) (Math.random() * 100);
            list.add(randint);
        }
        for (int i:list){
            System.out.println(i);
        }
        list.removeIf(new Predicate<Integer>() {
            @Override
            public boolean test(Integer integer) {
                if(integer % 2 == 0){
                    return true;
                }
                return false;
            }
        });
        System.out.println("************");
        for (int i:list){
            System.out.println(i);
        }

    }
}
